#ifndef _CIRCULARBUFFER_H_INCLUDED
#define _CIRCULARBUFFER_H_INCLUDED
template<class type>
class CircularBuffer {
   public:
                    CircularBuffer     (void);
                    CircularBuffer     (int maxElements);
                    CircularBuffer     (const CircularBuffer<type>& 
                                           anotherBuffer);
                   ~CircularBuffer     ();

      int           capacity           (void) const;
      int           getCount           (void) const;
      int           getSize            (void) const;
      type*         getArray           (int n,int &size);
      void          insert             (const type& aMessage);
      type          read               (void);
      void          reset              (void);
      void          setSize            (int aSize);
      void          print              (void);

   protected:
    
      type*         buffer;
      int           size;
      int           writeIndex;
      int           readIndex;
      int           itemCount;

      void          increment          (int& index);
      void          decrement          (int& index);
};


#include "CircularBuffer.cpp"

#endif  /* _CIRCULARBUFFER_H_INCLUDED */



